package org.springblade.modules.admin.enums;


import lombok.Getter;

/**
 * @Date 10:42 2021/8/25
 * @Description {
 *   电梯排期标签
 * }
 * @Author lsay
 **/
@Getter
public enum ElevatorScheduleLabelEnum {

	HAS_FUTURE_SCHEDULE(1,"有排期","电梯今天及以后有保养排期计划",""),
	NO_FUTURE_SCHEDULE(2,"无排期","电梯今天及以后无保养排期计划","排期数量异常"),
	LAST_PLAN_DATE_MOVE_15_DAYS(3,"年审梯末次排期距合同到期日超15天","合同期内年审梯，最后保养计划日期与合同结束日期相差相差超15天","排期数量异常"),
	HAS_FUTURE_SCHEDULE_AND_NO_FUTURE_CONTRACT(4,"已排期未续签合同","维保中电梯有保养排期计划，但合同尚未续签","排期数量异常"),
	MOVE_15_DAYS_SCHEDULE(5,"超15天排期","维保中年审梯保养排期计划间隔存在超15天合规风险","排期间隔异常"),
	SOLO_SCHEDULE(6,"年审梯单人排期风险","维保中年审梯下次保养计划是单人排期，存在合规风险","排期人数异常")
	;

	ElevatorScheduleLabelEnum(Integer code, String name,String desc,String type) {
		this.code = code;
		this.name = name;
		this.desc = desc;
		this.type = type;
	}

	private Integer code;
	private String name;
	private String desc;
	private String type;

	/**
	 * 根据id获取枚举name值
	 * @param code 枚举code
	 * @return name值
	 */
	public static String getName(Integer code){
		ElevatorScheduleLabelEnum[] values = ElevatorScheduleLabelEnum.values();
		for(ElevatorScheduleLabelEnum elevatorAuditEnum :values){
			Integer enumId = elevatorAuditEnum.getCode();
			if(code.equals(enumId)){
				return elevatorAuditEnum.getName();
			}
		}
		return null;
	}

}
